package com.kcsoft.mapper;

import com.kcsoft.pojo.Command;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CommandMapper {

    @Insert("insert into dxai.command (command, create_time) values (#{command} ,now())")
    void add(String command);

    @Select("select * from dxai.command where command=#{command}")
    Command findByCommand(String command);

    @Update("update dxai.command set total=total+1 where command=#{question}")
    void updateTotal(String question);

    @Select("select * from dxai.command")
    List<Command> list();

    @Delete("delete from dxai.command where id=#{id}")
    void delCommand(Integer id);
}
